package com.dao;

import com.entity.Chapter;
import com.entity.Course;
import com.github.pagehelper.PageInfo;
import com.vo.CourseVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CourseDao {
    //首页自动查询推荐的15个课程
    List<Course> selectTop15CoursesList();
    //    根据课程id查询三个最热的课程
    List<Course> selectThreeHotCourseByCourseId(@Param("courseId") Integer course_id);

    //通过参数查找课程--动态sql
    List<CourseVo> selectCourseByCourseVo(@Param("author") String author, @Param("course_name") String course_name, @Param("status") Integer status,
                                          @Param("course_type_id") Integer course_type_id,
                                          @Param("begin_date") Date begin_date, @Param("end_date") Date end_date);



    //通过id修改课程状态
    int updateCourseById(@Param("id") Integer id, @Param("status") Integer status);

    //通过course对象添加课程信息
    int insertCourseByCondition(Course course);

    //通过id查找课程
    Course selectCourseById(Integer courseId);

    //通过course对象修改课程信息
    int updateCourseByCondition(Course course);

    //====张
    //查询所有的课程
    List<Course> selectAllCourses();

    //根据课程类型id查询
    List<Course> selectByCourseTypeId(Integer ctid);

    //通过id获取章节
    List<Chapter> getChapterList(Integer courseId,Integer pageNo);

    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    List<Course> selectByCourseName(String courseName);

    List<Course> selectByCourseTypeId2(Integer ctid);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    //====张

    //获取课程列表
    public List<Course> getCourseList();
}
